﻿using LocalOverride.Fiddler.Store;
using LocalOverride.Fiddler.UI;
using NUnit.Framework;

namespace LocalOverride.Tests.UI
{
    [TestFixture]
    public class MappingEditPresenterFieldExtensions : MappingEditPresenterFieldTestBase
    {
        private readonly FileExtensionList validValue = new FileExtensionList{"js", "css"};
        private string DefaultValue = string.Empty;
        private const string ValidStringList = "js;css";
        protected override void SetupMappingWithValidValue(MappingEntry entry)
        {
            entry.FileExtensions = validValue;
        }

        protected override void SetupViewWithValidValue(IMappingEditorView view)
        {
            view.EditExtensions = ValidStringList;
        }

        protected override void AssertViewFieldContainsDefaultValue(IMappingEditorView mappingEditorView)
        {
            Assert.AreEqual(DefaultValue, mappingEditorView.EditExtensions);
        }

        protected override void AssertViewFieldContainsValidValue(IMappingEditorView mappingEditorView)
        {
            Assert.AreEqual(ValidStringList, mappingEditorView.EditExtensions);
        }

        [Test]
        public override void EditOverride_SetsEditFieldFromMapping()
        {
            base.EditOverride_SetsEditFieldFromMapping();
        }

        [Test]
        public override void SaveOverrideEdit_AddsEntryToStore_WhenNewOverride()
        {
            base.SaveOverrideEdit_AddsEntryToStore_WhenNewOverride();
        }
        
        [Test]
        public override void AddOverride_SetsDefaultValues()
        {
            base.AddOverride_SetsDefaultValues();
        }
    }
}